import 'package:audioplayers/audio_cache.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:getwidget/getwidget.dart';

class testPage extends StatefulWidget {
  const testPage({super.key});

  @override
  State<testPage> createState() => _testState();
}

class _testState extends State<testPage> {
  AudioCache audioCache = AudioCache();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(
          "測試頁",
          style: TextStyle(color: Colors.black),
        ),
        backgroundColor: Color.fromARGB(255, 237, 236, 236),
        // elevation: 1,
      ),
      body: Container(
          child: Column(
        children: [
          GFButton(
            onPressed: () {
              audioCache.play('../sounds/click.wav');
            },
            text: "播放聲音",
          )
        ],
      )),
    );
  }
}
